Skip to content

fix(codex): freeze verified context windows per turn - #3488

Closed
junshanxu wants to merge 1 commit into
makecindy:mainfrom
junshanxu:fix/codex-verified-context-window
Closed

fix(codex): freeze verified context windows per turn#3488
junshanxu wants to merge 1 commit into
makecindy:mainfrom
junshanxu:fix/codex-verified-context-window

Conversation

@junshanxu

@junshanxu junshanxu commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

这次改了什么

摘要

将已验证的自定义模型 context window 作为线程级配置传给 Codex,并把模型/provider/effort/service tier/线程配置冻结在发送入口。异步准备输入期间发生的切换从下一条消息生效。

变更类型

  • fix 缺陷修复
  • test 测试补充

范围

  • 关联 Issue / 需求:PR fix(codex): freeze verified context windows per turn #3488
  • 本 PR 包含:provider + model 维度的正整数窗口校验;新建、冷恢复、空闲切换时的线程窗口应用;活跃 turn 延迟应用与失败保留 pending;发送时路由快照;Desktop provider/model 切换串行化。
  • 明确不包含:gpt-5 sentinel 探测;approval/permission/reviewer 状态机扩展;外部 API、IPC、数据库或 wire schema 变化;Issue 维护者确认:PR #3488 架构改动(Codex 核心路径 / 大 diff) #3536 处理。
  • 用户可见变化:已验证窗口不再误用 Codex 基础默认窗口;切换发生在准备输入期间时,当前消息保持原路由,下一条消息使用新配置。
  • 是否存在 breaking change:无。

UI 变化

不涉及。

  • 引用的设计规范:不涉及 UI。

怎么验证的

自动验证

pnpm --filter @cindy/maker-core exec vitest run src/agents/codex/index.test.ts --reporter=dot
结果:568 passed

pnpm --filter desktop exec vitest run src/main/maker-ipc/__tests__/runtimeSetModel.test.ts --reporter=dot
结果:28 passed

pnpm --filter desktop exec eslint src/main/maker-ipc/runtimeSetModel.ts src/main/maker-ipc/__tests__/runtimeSetModel.test.ts
结果:通过

pnpm check:dco
结果:通过(1 commit signed off)

git diff --check
结果:通过

手工验证

不涉及实机 UI;本次无需使用本机 Cindy。已在受控 fake app-server host 中验证新建、恢复、空闲切换和异步输入快照调用序列。

未执行的验证

pnpm test:unit:related 曾在隔离 worktree 的临时依赖解析不完整时运行,出现跨 package collect failure,不能作为通过证据。Desktop 全量 typecheck 在同一隔离环境中无输出超时后停止;未将其标记为通过。定向 Codex/Desktop 测试与 Desktop ESLint 已通过。

推送后的 GitHub client-ci:Linux unit tests (1/2)、Windows 两个 shard、Desktop Git integration、verify-checks 和 DCO 通过;Linux unit tests (2/2) 因未改动的 apps/desktop/src/main/maker-host/__tests__/codexProxyHost.test.ts:154 5 秒超时失败,verify 随之失败。当前凭证无 repository admin 权限,无法重跑该失败 job。

风险

风险分类

  • 无已知风险
  • 权限 / 安全 / 用户数据

影响与回滚

  • 影响范围:CodexAgent 的线程配置生命周期、发送入口快照,以及 Desktop 的运行时 provider/model 切换串行化。
  • 回滚 / 降级方式:回退本 PR 即恢复原有 Codex 默认窗口和切换实现;无法验证窗口时始终省略 override,使用 Codex 默认行为。

本 PR 不引入 sentinel 探测,也不扩大 approval/permission/reviewer 体系。等待维护者审批,不合并。

@junshanxu
junshanxu requested a review from a team as a code owner August 27, 2026 04:34
@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown

Greptile Summary

Passes the host-verified, route-specific context window into Codex thread configuration while preserving Codex defaults for invalid or unavailable values.

  • Applies the override when starting and resuming threads.
  • Recomputes it for stale-daemon recovery after model changes.
  • Adds focused tests for verified, unverified, resumed, and recovery paths.

Confidence Score: 5/5

The PR appears safe to merge, with no actionable correctness or security issues identified in the changed paths.

The implementation uses the route-specific provider and catalog-model state, validates the resolved value before forwarding it, and omits the override when verification is unavailable.

Important Files Changed

Filename Overview
packages/maker-core/src/agents/codex/index.ts Resolves the verified route context window at thread-config assembly time and conditionally forwards only positive integers.
packages/maker-core/src/agents/codex/index.test.ts Covers new threads, resumed threads, unverified metadata, and stale-daemon recovery following a model switch.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Selected provider and catalog model] --> B[Resolve verified context window]
  B --> C{Positive integer?}
  C -->|Yes| D[Add model_context_window to thread config]
  C -->|No| E[Omit override]
  D --> F[Start or resume Codex thread]
  E --> F
Loading

Reviews (1): Last reviewed commit: "fix(codex): pass verified context window..." | Re-trigger Greptile

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2e10ee114a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/maker-core/src/agents/codex/index.ts Outdated
@MagicLizi

Copy link
Copy Markdown
Contributor

@yuaiccc 👋 这个 PR 还有 1 条 review conversation 没 resolve(packages/maker-core/src/agents/codex/index.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。

如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。

@MagicLizi MagicLizi added the status:awaiting-author 等作者修改(review-pr 自动维护,仅展示) label Aug 27, 2026

@MagicLizi MagicLizi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

格式门未通过:PR 描述缺仓库模板要求的段落「这次改了什么 / 怎么验证的 / 风险」。

当前描述用了 Summary / Scope / Testing,请改写成模板中的三段(可以把现有内容搬进去),补全后再请求审查。

@junshanxu

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 2e10ee114a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 000153bda2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/maker-core/src/agents/codex/index.ts Outdated
@junshanxu

Copy link
Copy Markdown
Contributor Author

@codex review 请基于最新提交 5691eb5 重新审查:已补上 gpt-5 哨兵在首次 thread/start 前的 model/list 解析,以及冷 thread/resume 响应后的线程窗口配置重应用;新增对应回归断言。

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5691eb535d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/maker-core/src/agents/codex/index.ts
Comment thread packages/maker-core/src/agents/codex/index.ts Outdated
@MagicLizi MagicLizi added awaiting-discussion 等待维护者讨论(review-pr) touches:core 改动碰到架构核心路径(review-pr 自动维护,仅展示) and removed status:awaiting-author 等作者修改(review-pr 自动维护,仅展示) labels Aug 27, 2026
@MagicLizi

Copy link
Copy Markdown
Contributor

@yuaiccc 👋 这个 PR 还有 2 条 review conversation 没 resolve(packages/maker-core/src/agents/codex/index.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。

如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。

@junshanxu

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 41fd0ec76d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/maker-core/src/agents/codex/index.ts Outdated
Comment thread packages/maker-core/src/agents/codex/index.ts Outdated
@junshanxu

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ce6ae79ba8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/maker-core/src/agents/codex/index.ts Outdated
@junshanxu

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 98d3349eb8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/maker-core/src/agents/codex/index.ts Outdated
@MagicLizi

Copy link
Copy Markdown
Contributor

@yuaiccc 👋 这个 PR 还有 1 条 review conversation 没 resolve(packages/maker-core/src/agents/codex/index.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。

如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。

@MagicLizi
MagicLizi dismissed their stale review August 27, 2026 09:18

这些问题已在当前 head 的后续 commit 中修复(格式门/安全门已通过),自动 dismiss 旧的 CHANGES_REQUESTED 以解除合并阻塞。

@MagicLizi MagicLizi added awaiting-discussion 等待维护者讨论(review-pr) and removed awaiting-discussion 等待维护者讨论(review-pr) labels Aug 27, 2026
@junshanxu

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

if (mutableModel === 'gpt-5' && resp.model) {
mutableModel = resp.model;
// 'gpt-5' 是「用 server 默认」的占位、本身不是目录条目,解析出的真实 id 才是
// 我们能拿到的最佳目录线索(与下方 wire 规范化不同,后者不更新它)。
mutableCatalogModel = resp.model;

P1 Badge 在启动响应解析后补应用线程窗口

model/list 预检失败、超时或未返回默认项时,新建会话仍会以 gpt-5 哨兵执行 thread/start,因此初始 config 没有 model_context_window;这里从响应取得具体模型后只更新两个可变字段,没有像冷恢复路径那样重新配置这个尚无 rollout 的线程,首轮仍按 Codex 基础窗口运行。相较已有评论,本版的新证据是冷恢复和 stale-daemon 分支已经增加补偿重应用,而该 ThreadStart 响应分支仍未设置 pending 标记或替换未使用线程。请在暴露 handle 前用解析后的模型重建线程配置。 docs/dev-rules/maker-core-and-agent-behavior.mdL66-L68

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@MagicLizi MagicLizi added awaiting-discussion 等待维护者讨论(review-pr) and removed awaiting-discussion 等待维护者讨论(review-pr) labels Aug 27, 2026
@MagicLizi MagicLizi added the touches:large-diff 改动量较大(review-pr 自动维护,仅展示) label Aug 28, 2026
@junshanxu

Copy link
Copy Markdown
Contributor Author

@codex review please review the latest commit 5d5d171. This is the converged frozen-permission snapshot fix: policy turns include Auto and Full access, and overload retries retain the permission mode represented by frozen turn params.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5d5d1711d8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/maker-core/src/agents/codex/index.ts Outdated
@junshanxu

Copy link
Copy Markdown
Contributor Author

@codex review please review the latest commit 8b34298. This closes the concrete policy-retry race identified on 5d5d171: retries snapshot the live mode at dispatch and preserve unattended state for Auto/Full transitions while turn/start is in flight.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8b3429838c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/maker-core/src/agents/codex/index.ts Outdated
@MagicLizi

Copy link
Copy Markdown
Contributor

@junshanxu 👋 这个 PR 还有 1 条 review conversation 没 resolve(packages/maker-core/src/agents/codex/index.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。

如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。

@junshanxu

Copy link
Copy Markdown
Contributor Author

@codex review please review the latest commit 181c1c8. This closes the concrete stale pending-tighten flag race: a policy retry launched under the live Ask mode clears the prior attempt marker; new Auto/Full transitions while turn/start is in flight re-arm it.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 181c1c8225

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@junshanxu
junshanxu force-pushed the fix/codex-verified-context-window branch from 181c1c8 to 1bf8f66 Compare August 28, 2026 17:30
@junshanxu junshanxu changed the title fix(codex): pass verified context window to thread config fix(codex): freeze verified context windows per turn Aug 28, 2026
@junshanxu

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1bf8f664cd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/maker-core/src/agents/codex/index.ts
@junshanxu

Copy link
Copy Markdown
Contributor Author

@codex review please review the latest commit 1bf8f66. This is the converged minimal fix: verified provider/model context windows, send-time route snapshot, deferred idle reapply, and serialized provider/model switches; sentinel probing and permission/reviewer state changes are intentionally out of scope.

@junshanxu
junshanxu force-pushed the fix/codex-verified-context-window branch from 1bf8f66 to c0d10cf Compare August 28, 2026 17:50
@junshanxu

Copy link
Copy Markdown
Contributor Author

@codex review please review the latest commit c0d10cf. The replacement-profile snapshot P1 is addressed; no sentinel or permission/reviewer expansion was added.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 1bf8f664cd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@MagicLizi MagicLizi removed the touches:large-diff 改动量较大(review-pr 自动维护,仅展示) label Aug 28, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: c0d10cfe34

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@junshanxu

Copy link
Copy Markdown
Contributor Author

当前提交 c0d10cf 的范围内 review 已收敛,Codex 最新审查无 major issue,未解决 thread 为 0。

目前唯一阻塞是 CI 的 Linux unit tests (2/2):未改动的 apps/desktop/src/main/maker-host/__tests__/codexProxyHost.test.ts:154 在 GitHub runner 上 5s timeout;verify 只是 consequential failure。该测试在本地单独运行通过,当前 token 没有 repository admin 权限,无法 rerun failed jobs。请维护者方便时 rerun 该 shard;通过后 PR 即停在 REVIEW_REQUIRED 等待维护者审批。

@MagicLizi

Copy link
Copy Markdown
Contributor

@junshanxu 👋 这个 PR 目前与 main 有合并冲突,auto-review 因此暂时跳过、没法继续审查 / 合并。

请在本地 merge 最新的 origin/main 解决冲突后推送;冲突解除后,下一轮 auto-review 会自动重新处理这个 PR。

Signed-off-by: yuaiccc <yuaiccc@aliyun.com>
@junshanxu
junshanxu force-pushed the fix/codex-verified-context-window branch from c0d10cf to 3cba929 Compare August 29, 2026 13:07
@junshanxu

Copy link
Copy Markdown
Contributor Author

已将 PR 变基到最新 origin/main(当前基线 56b7b9a9),解决 packages/maker-core/src/agents/codex/index.ts 的冲突;仍保持单一 DCO 提交。新 head:3cba9299a。请重新运行:@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3cba9299ae

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +6115 to +6117
const admissionTurnWorkspaceConfig = currentTurnWorkspaceConfig({
allowInactiveReadonlyProfile: true,
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 等待既有模型切换后再冻结审批路由

当调用方先发起但尚未 await 完成 setModel()、紧接着调用 send() 时,模型任务已经排入 modelChangeChain,但其主体尚未执行;这里先冻结旧路由的 approvalsReviewer,随后才在 6121–6122 行等待切换完成,最终会把新模型/provider 与旧审批能力组合。例如从支持原生 reviewer 的 OAuth 路由切到不支持的路由时,本轮仍发送 auto_review,可能直接失败;反向切换则会错误退回人工审批。与先前关于输入准备期间切换的评论不同,本版的新证据是“发送前已排队”的切换也因快照早于 await queuedChanges 而被拆成两套路由状态;应在等待链完成后冻结审批配置,或把审批能力纳入同一个路由快照。

AGENTS.md reference: AGENTS.md:L79-L81

Useful? React with 👍 / 👎.

@junshanxu

Copy link
Copy Markdown
Contributor Author

@codex review please review the rebased head 3cba929 after conflict resolution.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3cba9299ae

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

assertCurrentHost('thread/resume retry subscribe');
host.subscribeThread(threadId, handlers);
const resumeModel = mutableModel;
const resumeServiceTierGeneration = serviceTierMutationGeneration;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 按冻结路由保存 Fast 模式代次

send() 已冻结 standard 路由后,用户在异步输入准备或首次 turn/start 在途期间调用 setFastMode(true),若该请求随后以 thread not found 进入 stale-daemon 恢复,这里读取的是切换后的 serviceTierMutationGeneration,但下面的 resumeParams 仍发送冻结的 turnRoute.serviceTier。因此 resume 返回的 standard 状态会被误判为同代权威结果,并将 mutableServiceTier 及重试 turn 都改回 standard,导致用户刚开启的 Fast 本轮和后续都丢失。请将 service-tier 代次纳入冻结路由快照并据此校验响应,或在检测到较新的 mutation 时保留并补推最新值。

Useful? React with 👍 / 👎.

@MagicLizi

Copy link
Copy Markdown
Contributor

@junshanxu 👋 这个 PR 还有 2 条 review conversation 没 resolve(packages/maker-core/src/agents/codex/index.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。

如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。

1 similar comment
@MagicLizi

Copy link
Copy Markdown
Contributor

@junshanxu 👋 这个 PR 还有 2 条 review conversation 没 resolve(packages/maker-core/src/agents/codex/index.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。

如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。

@junshanxu

Copy link
Copy Markdown
Contributor Author

Closing this PR by maintainer direction. The remaining work crosses Codex core thread/profile lifecycle and has accumulated unresolved review discussions; it should be reconsidered only as a separately scoped, minimal proposal with an explicit core-owner review. The branch is intentionally retained for reference; no merge.

@junshanxu junshanxu closed this Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-discussion 等待维护者讨论(review-pr) touches:core 改动碰到架构核心路径(review-pr 自动维护,仅展示)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants